package com.itheima.mapper;

import com.itheima.entity.Banner;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BannerMapper {
    List<Banner> findByPage(String title);

    @Select("select * from tb_banner where id = #{id}")
    Banner findById(Integer id);

    void save(Banner banner);

    void update(Banner banner);

    @Delete("delete from tb_banner where id = #{id}")
    void deleteById(Integer id);

    void deleteByIds(Integer[] ids);

    @Select("select * from tb_banner")
    List<Banner> findAll();
}